﻿<?php 
include("../inc/global.inc");
if($_POST[act]){
      if($_SESSION['chkCode']==$_POST['c_code']){
	     $t_id=($_POST[t_id])?$_POST[t_id]:0;
		 @mysql_query("insert into tel (member_id,m_people,m_tel,m_phone,m_qq,add_time) values ('$t_id','$_POST[t_people]','$_POST[t_tel]','$_POST[t_phone]','$_POST[t_qq]','".date("Y-m-d H:i:s")."')");
   
         echo "<script>alert('申请成功');location='success.php';</script>";
		 
      }else{
        echo "<script>alert('验证码错误');location='javascript:history.go(-1)';</script>";
      }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>400电话申请表单-三帝贸易网为企业提供400电话申请，400电话只有企业才可以拥有的形象。</title>
<meta name="description" content="400电话申请表单，申请400电话，只有企业才拥有的企业形象，三帝贸易网免费开通400电话专区。" />
<meta name="keywords" content="400电话申请表单，申请400电话，400电话申请，400电话资费，400电话，三帝贸易网" />
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/link.css" rel="stylesheet" type="text/css" />
<link href="/css/head_2.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="css/reg.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("../inc/head_top.php")?>
<div class="top1">
<div style="float:left;width:242px;"><a href="/"><img src="/images/logo.gif" alt="三帝贸易网" border="0"/></a></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
<div class="onl"></div>
<div id="mian" class="topside6 sideyellow1">
<div class="title3 size12">400电话申请表单</div>
<div class="content size14">
  <div class="title2 b">申请400信息</div>
<form method="post" action="" onsubmit="return checkform()" name="form1">
<input type="hidden" name="t_id" value="<?=$_COOKIE[user_id]?>" />
<input type="hidden" name="act" value="ok" />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tbody>
      <tr>
        <td width="20%" align="right" bgcolor="#FFFFFF" >联系人<span class="fontred"> *</span></td>
        <td bgcolor="#FFFFFF"><input name="t_people" class="input1" id="t_people" size="35" /></td>
        </tr>
      <tr>
        <td width="20%" align="right" bgcolor="#F4F4F0" ><span class="text">&nbsp;电　话</span><span class="fontred"> *</span></td>
        <td bgcolor="#F4F4F0" ><input name="t_tel" class="input" id="t_tel" size="35" maxlength="16" /></td>
        </tr>
      <tr>
        <td width="20%" align="right" ><span class="text">手　机<span class="fontred"> *</span></span></td>
        <td ><input name="t_phone" class="input" id="t_phone" size="35" /></td>
        </tr>
      <tr>
        <td align="right" bgcolor="#F4F4F0" >QQ（MSN）<span class="fontred"> *</span></td>
        <td bgcolor="#F4F4F0" ><input name="t_qq" class="input" id="t_qq" size="35" /></td>
        </tr>
      <tr>
        <td align="right" >验证码<span class="fontred"> *</span></td>
        <td ><input 
name="c_code" class="input2" id="c_code" size="6" maxlength="6" />
        &nbsp;<img src="/inc/chk_num.php" align="absmiddle" id="img"/>&nbsp;<a href="#" name="test" id="test">看不清楚？</a></td>
        </tr>
    </tbody>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tbody>
      <tr>
        <td colspan="3" align="center" ><div class="content">
          <input type="submit" class="inputbutt" value="提交信息" />
         <br />
        </div></td>
      </tr>
    </tbody>
  </table></form>
</div>
</div>
<?php include("../inc/foot.php");?>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){

 if($("t_people").value.length==""){
    alert("联系人不能为空");
    $("t_people").focus();
    return false;
 }
 
  if($("t_tel").value.length==""){
    alert("联系人电话不能为空");
    $("t_tel").focus();
    return false;
 }
  if($("t_phone").value.length==""){
    alert("联系人手机不能为空");
    $("t_phone").focus();
    return false;
 }
 
  if($("t_qq").value.length==""){
    alert("联系人QQ（MSN）不能为空");
    $("t_qq").focus();
    return false;
 }
 
if($("c_code").value.length!=5){
  alert("请输入您的验证码");
  $("c_code").focus();
  return false;
}

}

function unisch(String) 
{ 
	var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-"; 
	var i; 
	var c; 
	for( i = 0; i < String.length; i ++ ) 
	{ 
		c = String.charAt( i ); 
		if (Letters.indexOf( c ) ==-1) 
		{ 
			return true; 
		} 
	} 
	return false; 
} 

function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="test";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>